class CreateHyperlinks < ActiveRecord::Migration
  def self.up
    create_table :hyperlinks do |t|
      t.string :name, :limit => 100, :null => false
      t.text :description, :null => false
      t.string :url, :limit => 255, :null => false
      t.references :course, :null => false

      t.timestamps
    end
    add_index(:hyperlinks, [:url,:course_id], :unique => true, :name => "uk_hyperlink_course")
  end

  def self.down
    drop_table :hyperlinks
  end
end
